package com.wteam.dragon.shop.pojo.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.wteam.dragon.system.basebean.bean.BaseBean;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 商品属性
 * @Author 陈晓辉
 * @Date 2020/6/29 15:31
 */
@Data
@Table
@TableName
@EqualsAndHashCode(callSuper = true)
public class ProductAttribute extends BaseBean {
    @IsKey
    @IsNotNull
    @IsAutoIncrement
    @TableId(type = IdType.AUTO)
    @ColumnType(MySqlTypeConstant.BIGINT)
    @Column(comment = "自增id")
    private Long id;

    @IsNotNull
    @Column(comment = "对应的商品类型id")
    @ColumnType(MySqlTypeConstant.BIGINT)
    private Long productTypeId;

    @IsNotNull
    @Column(comment = "属性名称")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String name;

    @IsNotNull
    @Column(comment = "属性名称(0 唯一 1 单选 2 复选)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer selectType;

    @IsNotNull
    @Column(comment = "属性录入方式：(0 手工录入 1 从列表中选取)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer inputType;

    @Column(comment = "属性名称")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String inputList;

    @IsNotNull
    @Column(comment = "排序")
    @ColumnType(MySqlTypeConstant.BIGINT)
    @DefaultValue("0")
    private Integer sort;

    //检索和关联

    @IsNotNull
    @Column(comment = "分类筛选样式 (0 普通 1 颜色)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer filterType;

    @IsNotNull
    @Column(comment = "检索类型 (0 不需要进行检索 1 关键字检索 2 范围检索)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer searchType;

    @IsNotNull
    @Column(comment = "相同属性产品是否关联 (0 不关联 1 关联)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer relatedStatus;

    @IsNotNull
    @Column(comment = "是否支持手动新增 (0 不支持 1 支持)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer handAddStatus;

    @IsNotNull
    @Column(comment = "属性的类型 (0 规格 1 参数)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer type;
}
